package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-04-14
 * Time: 17:33
 * 书架
 */
public class BookList {
    private Book[] books=new Book[10];//最多放10本
    private int usedSize;//数组放了几本书

    public BookList() {
        books[0]=new Book("三国演义","罗贯中",90,"小说");
        books[1]=new Book("西游记","吴承恩",90,"小说");
        books[2]=new Book("红楼梦","曹雪芹",90,"小说");
        this.usedSize=3;
    }

   //获取当前数组大小
    public int getUsedSize() {
        return usedSize;
    }
//修改当前数组素数个数
    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
    //拿到当前数组下标的书
    public Book getPos(int pos){
        return books[pos];
    }
    //给数组pos位置放置一本书
    public void setBooks(int pos,Book book){
        books[pos]=book;
    }
}
